home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr23 / csmac13a.zip / CS-LOGON.CSM < prev    next >
Text File  |  1995-01-22  |  55KB  |  1,234 lines

  1.  
  2.  ┌────────────────────────────────┐
  3.  │  Chuck Seyboldt's COMMO Macro  │   CS-MAC13A:CS-LOGON.CSM
  4.  └────────────────────────────────┘   Copyright (c) 1995
  5.   *                                   All rights reserved
  6.   *
  7.   *  Contents:       Generic logon routine (:glr)
  8.   *                  Test for ACTION (and call to CS-ACTON.CSM)
  9.   *                  Get NEWFILES list if %flag contains "n"
  10.   *                  Getting to mail door
  11.   *                  Rename .QWK packets
  12.   *                  Test for .REP
  13.   *                  Strew files from Hold directory (optional)
  14.   *
  15.   *  Called from:    CS-TABLE.CSM
  16.   *
  17.   *  Control passes to:  CS-ACTON.CSM,action  (if ACTION.%abbr exists)
  18.   *                      CS-COMMO.CSM,fon_dial(multi-dialer routine)
  19.   *
  20.   *  The file you are reading does  *NOT*  require editing.
  21.   *
  22. ***  BBSID particulars need to be added to COMMO.FON.
  23.   *
  24.   *  This file contains a logon macro.
  25.   *  It is designed to get you quickest to the "Main BBS Command?"
  26.   *  prompt.  BBSware specific prompts are delivered from CS-TABLE.CSM.
  27.   *  After logon, a MAILRUN is made.  If the Commo variable %MAIL is
  28.   *  empty, control passes back to CS-COMMO.CSM.
  29.   *
  30.   *  This works for PCBoards, for the RBBS run by Jim Goodenough,
  31.   *  Directory Assistance  (1,707 823-9516), for Jeff Oberlee's
  32.   *  Charlies Foxhole BBS running MACROBBS (1,517 323-3405), for
  33.   *  Wildcat! boards, and for Bob Mahoney's Exec-PC BBS.  More
  34.   *  BBS types are accomodated by expanding CS-TABLE.CSM.  In
  35.   *  general, turn any BBS HOTKEY option to OFF.
  36.  
  37.  ┌─────────────────────────────┐
  38.  │  Standard Online Responses  │  (For the Generic Logon Routine)
  39.  └─────────────────────────────┘
  40.   *  Responses to common logging-on prompts.
  41.   *   :name sends first plus last name with one carriage return.
  42.   *   :alias sends your alias which may be in effect for one call
  43.   *   :f&l sends "first name <CR>", delays, then sends "last name <CR>"
  44.   *   :handle sends your handle rather than your name
  45.   *  Notice that I have a different response to the "First name?"
  46.   *  prompt for the BBS called Directory Assistance.
  47.  
  48.  {:retu} {comp debug}               ;check %debug
  49.          {ifco ,stamp}              ;if NUL, go on; else goto :stamp}
  50.          {retu}                     ;Handy label and function assignment
  51.  
  52.  {:stamp}{incr db_ct}               ;stamp for debugging
  53.          {disp ,,,## %_24h%:%_min%:%_sec% CS-LOGON ##%db_ct##} {retu}
  54.  
  55.  {:name} {comp alias} {ifco ,alias}
  56.          {comp ql,y}{ifco qlog}     ;Do QuickLogOn if %ql=y
  57.          {send ~%name|} {retu}
  58.  {:alias}{send ~%alias|}{retu}
  59.  {:qlog} {setv ql}                  ;clear "ql" for single dial
  60.          {comp qlo} {ifco name}     ;error trap
  61.          {send ~%qlo}               ;%qlo in CS-TABLE needs <CR>
  62.          {setv qlo}
  63.          {goto qlo_1}               ;logged-on
  64.  
  65.  {:f&l}  {comp alias} {ifco-c ,a2n}
  66.          {inst name, }              ;find "space" in name
  67.          {setv pos,%_pos} {decr pos}
  68.          {subs first,1,%pos,%name}
  69.          {leng %name} {incr pos,2}
  70.          {subs last,%pos,%_len,%name}
  71.          {send ~%first|~~~~~%last|} ;Send first and last name 2.5 sec apart
  72.          {setv first}               ;reset variables
  73.          {setv last}
  74.          {comp alias} {ifco-c ,n2a}
  75.          {retu}
  76.  {:a2n}  {setv sav,%name} {setv name,%alias} {retu}
  77.  {:n2a}  {setv name,%sav} {setv sav}   {retu}
  78.  
  79.  {:handle}
  80.          {comp alias} {ifco ,alias}
  81.          {send ~%handle|}    {goto retu} ;Send %handle
  82.  
  83.  {:lov}  {send ~%v_ph%|}     {goto retu} ;Voice Phone Number verification
  84.  {:lod}  {send ~%d_ph%|}     {goto retu} ;Data  Phone Number verification
  85.  {:lob}  {send ~%b_day%%rs}  {goto retu} ;Birthday verification
  86.  {:loq}  {send %color %fast|}{goto retu} ;choose ANSI colors  "Y/n"
  87.  {:bbs}  {send ~bbs|}        {goto retu}
  88.  {:_}    {send ~ }           {goto retu} ;this is how to send "SpaceBar"
  89.  {:|}    {send ~|}           {goto retu}
  90.  {:_|}   {send ~ |}          {goto retu}
  91.  {:a|}   {send ~a|}          {goto retu}
  92.  {:c|}   {send ~c|}          {goto retu}
  93.  {:g|}   {send ~g|}          {goto retu}
  94.  {:n}    {send ~n}           {goto retu}
  95.  {:n|}   {send ~n|}          {goto retu}
  96.  {:q}    {send ~q}           {goto retu}
  97.  {:q|}   {send ~q|}          {goto retu}
  98.  {:s}    {send ~s}           {goto retu}
  99.  {:s|}   {send ~s|}          {goto retu}
  100.  {:u|}   {send ~u|}          {goto retu}
  101.  {:y}    {send ~y}           {goto retu}
  102.  {:y|}   {send ~y|}          {goto retu}
  103.  {:z}    {send ~z}           {goto retu}
  104.  {:z|}   {send ~z|}          {goto retu}
  105.  {:0|}   {send ~0|}          {goto retu}
  106.  {:5|}   {send ~5|}          {goto retu}
  107.  {:loe}  {send ~~^[^[}       {goto retu} ;this is sending two "Esc" presses
  108.  {:pas|} {send %_pas|}       {goto retu} ;this sends your password
  109.  
  110.  {:mprot}{comp or_prot}
  111.          {ifco ,orprot}
  112.          {comp mprot} {ifco-c mp__z}
  113.          {send ~%mprot}      {goto retu} ;this sends your mail fetching protocol
  114. {:orprot}{send ~%or_prot}    {goto retu}
  115.  
  116.  {:no}   {send ~%no}{pops-c} {goto ndl}
  117.  {:c_x}  {comp _prot,k} {ifco qdl}       ;no way to quit kermit once started
  118.          {paus 4}   {pops-c}
  119.          {send ~^x^x^x^x^x^x^x} {goto ndl}
  120.  
  121.  {:at_bbs}{pops-c}
  122.          {setv at_bbspmt,y}  {goto byz}  ;Known that we are at bbs prompt
  123.  
  124.  {:retry}{paus 2} {send r|} {goto db_1}  ;If bad name entered
  125.  
  126.  {:un_pfl} {setv pfl} {retu}             ;"No mail" message during logon
  127.   ; clears %pfl which you may set in .FON.  This is a reverse of mail
  128.   ; check logic in that it assumes there is mail, but will not uqwk if
  129.   ; the "No mail" message appears during logon.  See TABLE:int bypass9.
  130.  ┌─────────────────────────┐
  131.  │  Generic Logon Routine  │
  132.  └─────────────────────────┘
  133.   *  This logon macro works for times you DON'T want to
  134.   *  make a mail run.  It is designed to get you quickest to the
  135.   *  "Main BBS Command?" prompt.
  136.   *
  137.   *  It is necessary that this routine be reached via CS-TABLE.CSM
  138.   *  since several BBS prompts are set there.
  139.  
  140.  {:glr}
  141.           info-d5 Logging on Now
  142.           spdc n                    ;Blind display "for the bold"
  143.          {spdc y}
  144.          {setv ss_z,~z}             ;for PowerBBS upload protocol
  145.          {setv ss_gr,~g|}           ;for DCQwk  <G> to start
  146.          {setv ss_ur,~u|}           ;for O_QWKer
  147.          {setv ss_bs,^h}            ;timer reset while waiting for d/l
  148.          {beep}
  149.          {wind}
  150.          {setv 2,1}                 ;%2 is a door counter
  151.          {sete-p0 log_esc}          ;point to ESCape routine (during logon)
  152.          {noca bya}                 ;point to lost carrier routine
  153.          {setv at_bbspmt}           ;clear at-BBS flag
  154.          {setv nodl}                ;clear no-download flag
  155.          {comp debug}{ifco db_1}    ;using %debug variable to open
  156.          {capm raw}                 ; a capture file to facilitate
  157.          {setv capt,on}             ; troubleshooting when necessary
  158.          {setv db_ct,0}             ; counter for debug marks
  159.          {capt y,%_hom%debug.cap}
  160.  {:db_1} {pops-c}
  161.          {push}                     ;push + pops acts like "call"
  162.          {setl 60,ab_pa}            ;allow 60 seconds to password prompt
  163.          {golo loe, twice}          ;send Escape twice  "Front End"
  164.          {golo loe, (ESC)}          ;send Escape twice  "Binkley"
  165.          {golo loe,[ESC]}           ;send Escape twice  "1st Amendment BBS"
  166.          {golo loe,ESCape}          ;send Escape, another Binkley
  167.          {golo loe,InterMail }      ;InterMail front end
  168.                                      {comp fe_pmt}{ifco no_fe}
  169.          {golo loe,%fe_pmt} {:no_fe};user definable "Front-end" prompt in .FON
  170.          {golo y%rs,orrect?}        ;send 'y' when caller ID is asked
  171.          {golo bbs, request: }      ;NLBBS Front End, part I
  172.          {golo _|,Login: }          ;NLBBS Front End, part II
  173.          {golo n|,A>?}              ;just say 'no' RBBS prompt
  174.  
  175.          {golo |, [Y,n}             ;MAXIMUS BBS "name?" confirmation
  176.                                     ;  and More [Y,n,=]? prompt
  177.          {golo onl,%bbs_pmt}        ;Logged on via "quick" logon
  178.          {golo %lan_pmt}            ;send language response "CS-TABLE.CSM"
  179.          {golo %gra_pmt}            ;send graphics instructions "CS-TABLE.CSM"
  180.          {golo %nam_pmt}            ;send name "Prompt from CS-TABLE.CSM"
  181.  
  182.          {look %pwd_pmt}            ;Logon macro has two "lookfors"
  183.          {paus 1} {call pas|}       ; Why?  To accomodate more golooks.
  184.  
  185.  {:qlo_1}{pops-c}                   ;hits here on quick logon
  186.          {push}
  187.          {setl 60,ab_bb}            ;allow 60 seconds to BBSware prompt
  188.          {golo %bypass1}            ;These BBSware specific 'pause-
  189.          {golo %bypass2}            ;  avoiding-responses' are set in
  190.          {golo %bypass3}            ;  CS-TABLE.CSM
  191.          {golo %bypass4}
  192.          {golo %bypass5}
  193.          {golo %bypass6}
  194.          {golo %bypass7}
  195.          {golo %bypass8}
  196.          {golo %bypass9}
  197.  
  198.          {golo n|,[y/n]?}           ;just say 'no' to "Y/n"
  199.          {golo n|,=yes?}            ;just say 'no' to "mail scan"
  200.          {golo c|,inue? [}          ;[C]ontinue to -pause- prompt
  201.  
  202.          {golo pas|,Wrong passw}    ;resend password if necessary
  203.  
  204.          {look %bbs_pmt}            ;Generic Logon Complete
  205.  {:onl}  {spdc y}    {pops-c}       ;All set.  Logged-ON.
  206.          {comp debug,y} {ifco ,ac_pr}
  207.          {incr db_ct}
  208.          {disp ,,,## %_24h%:%_min%.%_sec% LOGGED-ON ##%db_ct##}
  209.  
  210.  ┌─────────────────────────┐
  211.  │  Call ACTION Processor  │
  212.  └─────────────────────────┘
  213.  {:ac_pr}{ifex %_hom%action.%abbr%,,noact}     ;CALL "ACTION processor"
  214.          {wind-k}
  215.          {setv _menu1,'S' to skip ACTION  ■  Any other key continues}
  216.          {setv _mlabel,ac_a}
  217.          {subs _mcolor,31,5,%palette}
  218.          {keys 61}
  219.          {menu 3,50,CS-MAC%ver}
  220.  {:ac_a} {beep}
  221.          {setg 10,doact,n}                     ;if response is <CR>, do
  222.          {gets-hi count,1,doact}               ;using Commo for timed branch
  223.          {comp count,s} {ifco noact,doact}     ;15 second delay, default=do
  224.  
  225. {:doact} {wind} {goto action,cs-acton.csm}     ;CS-ACTON.CSM Returns to :noact
  226.  
  227.  ┌─────────────────────────────────────────┐
  228.  │  "FLAG" events may be called from here  │
  229.  └─────────────────────────────────────────┘
  230.   *  A %flag% variable is used to call for NEWFILE scans.
  231.   *  You should set the %flag variable in COMMO.FON
  232.   *  Setting .... flag,n ... "n" runs :NEWFILES,
  233.   *
  234.   *  This facility is setup for easy expansion.
  235.  
  236.  {:noact}{wind}
  237.          {sete-p0 log_esc}                     ;ESCape (after trip to CS-ACTON)
  238.          {comp inet} {ifco ,do_inet}           ;%inet logon, mark & telnet
  239.          {comp mail} {ifco log_esc}            ;If %mail empty, quit macro here
  240.          {comp bbsid}{ifco log_esc}            ;If %bbsid empty, quit
  241.          {inst flag,n} {ifco-c newfiles}       ;otherwise, run %flag
  242.  
  243.  ┌─────────────────────────┐
  244.  │  MailRun Routine Start  │
  245.  └─────────────────────────┘
  246.   *  Checking for a .REP file.  If a REP exists, you are offered
  247.   *  the option to only upload those replies.  But, the default action
  248.   *  is to get a QWK.  This way, unattended sessions fetch a .QWK
  249.   *  Or, by presetting the variable %skip to "nl", you can skip the
  250.   *  attempt to download mail from the "NLBBS".
  251.  
  252.          {comp skip,%abbr} {ifco n_d}          ;"skip" flags
  253.          {comp skip,y}     {ifco n_d}
  254.          {ifex %repdr\%bbsid.%rep,ask,d_l}     ;GOTO mailrun routines
  255.  
  256.  {:ask}  {wind-k}
  257.          {setv _menu1,(C)ontinue mail d/l NOW ■ 'S' to skip d/l}
  258.          {setv _mlabel,re_a}
  259.          {subs _mcolor,31,5,%palette}
  260.          {keys 61}
  261.          {menu 3,45,CS-MAC%ver}
  262.  {:re_a} {beep}
  263.          {setg 10,d_l,n}
  264.          {gets-hi count,1,d_l}                 ;using Commo for timed branch
  265.          {comp count,s} {ifco n_d,d_l}         ;15 second delay, default=d/l
  266.  
  267.  {:n_d}  {wind}
  268.          {setv nodl,y}                         ;set flag to skip mail d/l
  269.          {ifex %repdr\%bbsid.%rep,,at_bbs}     ;if no .rep, Goodbye
  270.  
  271.  ┌───────────────────────────────┐
  272.  │  Get to the Mail Door Prompt  │
  273.  └───────────────────────────────┘
  274.  {:d_l}  {wind}
  275.          {comp quit}  {ifco qul}    ;Any built-in mail command, quit  == NUL
  276.          {comp dorno} {ifco qul}    ;Any built-in mail command, dorno == NUL
  277.          {setv at_bbspmt}
  278.          {send ~%dorno}             ;command to open mail door
  279.          {push}
  280.          {setl 60,ab_mw}            ;allow 60 secs to get to MAILware prompt
  281.          {golo at_bbs,invalid}      ;for invalid door selection
  282.          {golo at_bbs,%bbs_pmt}     ;if unable to enter door
  283.          {golo ch_at,%chat_str}     ;respond to sysop CHAT request
  284.          {golo %md_bypa1}           ;generic "continue... " from CS-TABLE
  285.          {golo ndl,sorry,}          ;for T.A.G. unable to enter door
  286.          {look %md_pmt}             ;from CS-TABLE.CSM prompt table
  287.          {comp debug,y} {ifco ,qul}
  288.          {incr db_ct}
  289.          {disp ,,,## %_24h%:%_min%.%_sec% AT MAIL DOOR PROMPT ##%db_ct##}
  290.  
  291.  ┌─────────────────┐
  292.  │  Upload a .REP  │
  293.  └─────────────────┘
  294.   *  If a .REP exists, it is sent before download attempt.
  295.  
  296.  {:qul}  {pops}
  297.          {ifex %repdr\%bbsid.%rep,,nup}
  298.          {exec-n echo %repdr\%bbsid.%rep> %_hom%^(send^).lst}
  299.          {send ~%up}
  300.          {setl 30,ab_mu}            ;allow 30 seconds to start upload
  301.          {call ul_rep}              ;call upload rep subroutine
  302.          {pops-c}
  303.          {push}
  304.          {setl 120,ab_up}           ;allow 120 seconds to process upload
  305.          {golo ch_at,%chat_str}     ;respond to sysop CHAT request
  306.          {golo %md_bypa1}           ;generic "continue... " from CS-TABLE
  307.          {look %md_pmt}
  308.          {pops}
  309.          {comp mail,uqw} {ifco-c uqw_up}        ;call uqwk subroutine
  310.          {comp debug,y} {ifco ,nup}
  311.          {incr db_ct}
  312.          {disp ,,,## %_24h%:%_min%.%_sec% REP UPLOAD DONE ##%db_ct##}
  313.  
  314.  ┌───────────────────┐
  315.  │  Download a .QWK  │
  316.  └───────────────────┘
  317.   *  The ":nup" section would be skipped if you decided to skip .QWK
  318.   *  downloading in the "Mailrun Routine Start, :ask" section.
  319.  
  320.  {:nup}  {comp nodl,y} {ifco byz}   ;Skip d/l if %nodl=y
  321.          {send ~%dn}                ;Otherwise, scan for messages
  322.          {push}
  323.          {setl 120,ab_md}           ;allow 120 secs to prep download
  324.                                     ; as far as message counting
  325.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from CS-TABLE.CSM"
  326.          {golo %md_brnch}           ;Branch, refer to MAILware CS-TABLE.CSM
  327.          {golo %md_bypa1}           ;Call, refer to MAILware CS-TABLE.CSM
  328.          {golo ch_at,%chat_str}     ;respond to sysop CHAT request
  329.          {golo retu,^m}             ;reset timer if door is active
  330.  
  331.          {look Message Count}
  332.          {goto qdl}                 ;not likely to hit this line
  333.  
  334.  {:p_flg}{setv pmail,Mail @ %_24h%:%_min on %_dat}  ;Set Autopilot message
  335.          {setv pfl,y}               ;Cleared at :qdl routine
  336.          {retu}                     ;Cleared on Alt-C or on Alt-A "No" response
  337.  ┌────────────────────────────────────────────────┐
  338.  │  Count Messages  or  Extended maildoor prompts │
  339.  └────────────────────────────────────────────────┘
  340.   *  It is possible to add routines specific to any MAILware.
  341.   *  Use the variable %md_branch defined in CS-TABLE.CSM to choose the
  342.   *  appropriate maildoor interaction and message counting routine.
  343.   *
  344.   *  This section will skip the RENQWK and any attempt to download if
  345.   *  the maildoor scans less than %min_msg messages for your .QWK packet.
  346.  
  347.  {:c_blu}
  348.          {setg ,,l,^m}              ;Bluewave message counting
  349.          {gets count,12}            ;get total message count
  350.          {subs count,-4,4,%count}   ;take last 4 characters  total
  351.          {look ALL NEW mail.}       ;Bluewave bundling command
  352.          {send ~|}                  ;bundle any packet to get to ...
  353.          {look %xfer_pmt}           ; mail transfer prompt
  354.          {comp count,%min_msg}      ;if less than %min_msg total messages,
  355.          {ifco-l no,qdl}            ; then skip download
  356.  
  357.  {:c_cam}
  358.          {setg ,,l,^m}              ;Cam-Mail message counting
  359.          {gets person,15}           ;get total message count   w/ANSI
  360.          {subs person,-4,4,%person} ;take last 4 characters  total
  361.          {look .......}             ;Cam-Mail personal message count
  362.          {gets count,15}            ;get personal message count  w/ANSI
  363.          {subs count,-4,4,%count}   ;take last 4 characters  personal
  364.          {golo ndl,%mt_qwk}         ;eMpTy .QWK message "from CS-TABLE.CSM"
  365.          {look %xfer_pmt}
  366.          {comp person,1}            ;check for personal messages
  367.          {ifco-gec p_flg}           ;set autopilot message
  368.          {ifco-ge qdl}              ; if any, do download ... but ...
  369.          {comp count,%min_msg}      ;if less than %min_msg total messages,
  370.          {ifco-l no,qdl}            ; then skip download
  371.  
  372.  {:c_coq}
  373.          {setg ,,l,^m}              ;Message counting
  374.          {gets count,74}            ;for Charlie's Offline Reader
  375.          {subs count,-3,3,%count}   ;take last 3 characters  total
  376.          {golo ndl,%mt_qwk}
  377.          {look %xfer_pmt}
  378.          {comp count,25}
  379.          {ifco-l no,qdl}
  380.  
  381.  {:c_exq}
  382.          {call y}
  383.          {sslo ss_bs,.}
  384.          {look %xfer_pmt}           ;prompted by "autodownload"
  385.          {goto qdl}
  386.  
  387.  {:c_lak}
  388.          {call n}       [N T Q]?    ;LAKOTA Download menu (new messages)
  389.          {push}
  390.          {golo y,[A S Y Q]?}        ;LAKOTA Conference menu (Your queue)
  391.          {golo mprot,[X Y Z Q]?}    ;LAKOTA Protocol menu (sends %mprot)
  392.          {look %xfer_pmt}
  393.          {pops}
  394.          {goto qdl}
  395.  
  396.  {:c_mm2}
  397.          {setg ,,l,^m}              ;MarkMail2 message counting
  398.          {gets count,16}
  399.          {subs count,-4,4,%count}
  400.          {look sages: }
  401.          {gets person,16}
  402.          {subs person,-4,4,%person}
  403.          {golo ndl,%mt_qwk}
  404.          {look %xfer_pmt}
  405.          {comp person,1}
  406.          {ifco-gec p_flg}
  407.          {ifco-ge qdl}
  408.          {comp count,%min_msg}
  409.          {ifco-l no,qdl}
  410.  
  411.  {:c_mmj}
  412.          {setg ,,l,^m}              ;MajorBBS QWK mail message counting
  413.          {gets count,5}
  414.          {look %xfer_pmt}
  415.          {inst count,[}
  416.          {setv pos,%_pos}{decr pos}
  417.          {subs count,1,%pos,%count}
  418.          {comp count,%min_msg}
  419.          {ifco-l no,qdl}
  420.  
  421.  {:c_mmp}
  422.          {call q}       [a]scii:    ;MacroBBS packer choose .qwk
  423.          {look Total:    }
  424.          {setg ,,l,^m}              ;MacroBBS QWK mail message counting
  425.          {gets count,9}             ; doesn't really count, just resets
  426.          {push}                     ; the setl timer with a fresh look.
  427.          {golo y,download: }
  428.          {golo retu,^m}             ;reset timer if door is active
  429.          {look %xfer_pmt}
  430.          {goto qdl}
  431.  
  432.  {:c_p15}
  433.          {setg ,,l,^m}              ;PCBoard 15.x QWK message counting
  434.          {gets count,5}
  435.          {look %xfer_pmt}
  436.          {comp pfl} {ifco ,qdl}
  437.          {comp count,%min_msg}
  438.          {ifco-l c_x,qdl}
  439.  
  440.  {:c_pwq}  (Total Messages: 28)  (Total Messages: 28)
  441.          {call a|}                  ;PowerBBS [A]ll Chosen Forums
  442.          {look Messages:}
  443.          {setg ,,l,^m}              ;PowerBBS QWK message counting
  444.          {gets count,25}
  445.          {look %xfer_pmt}
  446.          {inst count,} {ifco pwq_esc}  ;count from ESC -or-
  447.          {inst count,)}                 ;count from close paren
  448.  {:pwq_esc}
  449.          {setv pos,%_pos}{decr pos}
  450.          {subs count,1,%pos,%count}
  451.          {comp count,%min_msg}
  452.          {ifco-l no,qdl}
  453.  
  454.  {:c_qm2}
  455.          {setg ,,l,^m}              ;Qmail2 message counting
  456.          {gets count,18}
  457.          {subs count,-4,4,%count}
  458.          {look gs Found....}
  459.          {gets person,18}
  460.          {subs person,-4,4,%person}
  461.          {golo ndl,%mt_qwk}
  462.          {look %xfer_pmt}
  463.          {comp person,1}
  464.          {ifco-gec p_flg}
  465.          {ifco-ge qdl}
  466.          {comp count,%min_msg}
  467.          {ifco-l no,qdl}
  468.  
  469.  {:c_qm4}
  470.          {setg ,,l,^m}              ;Qmail4 message counting
  471.          {gets count,18}
  472.          {subs count,-4,4,%count}
  473.          {look Found.....}
  474.          {gets person,18}
  475.          {subs person,-4,4,%person}
  476.          {golo ndl,%mt_qwk}
  477.          {look %xfer_pmt}
  478.          {comp person,1}
  479.          {ifco-gec p_flg}
  480.          {ifco-ge qdl}
  481.          {comp count,%min_msg}
  482.          {ifco-l no,qdl}
  483.  
  484.  {:c_roz}
  485.          {setg ,,l,^m}              ;Rosemail message counting
  486.          {gets count,4}
  487.          {subs count,-4,4,%count}
  488.          {look you     :}
  489.          {gets person,4}
  490.          {subs person,-4,4,%person}
  491.          {golo ndl,%mt_qwk}
  492.          {look %xfer_pmt}
  493.          {comp person,1}
  494.          {ifco-gec p_flg}
  495.          {ifco-ge qdl}
  496.          {comp count,%min_msg}
  497.          {ifco-l no,qdl}
  498.  
  499.  {:c_slx}
  500.          {setg ,,l,^m}              ;Silver Express message counting
  501.          {gets count,4}             ;get total message count
  502.          {look %xfer_pmt}           ; mail transfer prompt
  503.          {comp count,%min_msg}      ;if less than %min_msg total messages,
  504.          {ifco-l no,qdl}            ; then skip download
  505.  
  506.  {:c_tma}
  507.  Total messages: ###Your Messages : ##
  508.          {setg ,,l,^m}              ;TriMail message counting
  509.          {gets count,18}
  510.          {look Messages : }
  511.          {gets person,18}
  512.          {golo ndl,%mt_qwk}
  513.          {look %xfer_pmt}
  514.          {inst count,m} {setv pos,%_pos} {incr pos}
  515.          {subs count,%pos,3,%count}
  516.          {inst person,m} {setv pos,%_pos} {incr pos}
  517.          {subs person,%pos,3,%person}
  518.          {comp person,1}
  519.          {ifco-gec p_flg}
  520.          {ifco-ge qdl}
  521.          {comp count,%min_msg}
  522.          {ifco-l no,qdl}
  523.  
  524.  {:c_tc!}
  525.  messages found: ### (## personal)
  526.          {setg ,,l,^m}              ;TomCat! message counting
  527.          {gets count,40}
  528.          {golo ndl,%mt_qwk}
  529.          {look %xfer_pmt}
  530.          {inst count,(}
  531.          {ifco-c p_flg} {ifco qdl}  ;personal message, download
  532.          {inst count,m} {setv pos,%_pos} {incr pos}
  533.          {subs count,%pos,5,%count}
  534.          {inst count,} {ifco ,c_tc!1}
  535.          {setv pos,%_pos}{decr pos}
  536.          {subs count,1,%pos,%count}
  537.  {:c_tc!1}
  538.          {comp count,%min_msg}
  539.          {ifco-l no,qdl}
  540.  
  541.  {:uqw_up}
  542.          {send unzip -U %bbsid.%rep|}
  543.          {look %bbs_pmt}
  544.          {send uqwk -m -n %uqwk_up -R%uqwk_r%|}
  545.          {look %bbs_pmt}
  546.          {push}
  547.          {send rm %bbsid.%rep|}
  548.          {golo y|,rm: remove}
  549.          {look %bbs_pmt}
  550.          {pops}
  551.          {retu}
  552.  
  553.  {:c_uqw}
  554.          {look %bbs_pmt}           ;uqwk download submacro
  555.  {send zip -k -m %bbsid.%qwk *.DAT *.NDX *.MSG AREAS *.JN *.NWS *.IDX *.MAI|}
  556.          {look %bbs_pmt}     ─────┬───── ──────┬──── ───────────┬──────────
  557.          {goto qdl}          QWK ─┘      SOUP ─┘       ZIPNews ─┘
  558.  
  559.  {:c_wci}
  560.          {setg ,,l,^m}              ;Wildcat! internal mail counting
  561.          {gets count,18}
  562.          {inst count,m} {setv pos,%_pos} {incr pos}
  563.          {subs count,%pos,3,%count}
  564.          {look %xfer_pmt}
  565.          {comp count,%min_msg}
  566.          {ifco-l no,qdl}
  567.  
  568.  {:c_wcm}
  569.  messages found: ### (## personal)
  570.          {setg ,,l,^m}              ;wcMAIL message counting
  571.          {gets count,40}
  572.          {golo ndl,%mt_qwk}
  573.          {look %xfer_pmt}
  574.          {inst count,(}
  575.          {ifco-c p_flg} {ifco qdl}  ;personal message, download
  576.          {inst count,m} {setv pos,%_pos} {incr pos}
  577.          {subs count,%pos,5,%count}
  578.          {inst count,} {ifco ,c_wcm1}
  579.          {setv pos,%_pos}{decr pos}
  580.          {subs count,1,%pos,%count}
  581.  {:c_wcm1}
  582.          {comp count,%min_msg}
  583.          {ifco-l no,qdl}
  584.  
  585.  {:c_zns}
  586.          {setg ,,l,^m}              ;Message counting for
  587.          {gets count,9}             ;Jack Kilday's ZIPNews door
  588.          {subs count,-3,3,%count}
  589.          {golo ndl,%mt_qwk}         ;ZIPNews "empty" occurs after count
  590.          {look %xfer_pmt}
  591.          {comp pfl}                 ;%pfl set during mail/news scan
  592.          {ifco ,qdl}                ;Take a packet with personal mail
  593.          {comp count,%zmin_msg}
  594.          {ifco-l no,qdl}
  595.  
  596.  ┌─────────────────────────────────┐
  597.  │  Call .QWK rename and Download  │
  598.  └─────────────────────────────────┘
  599.  {:qdl}  {pops-c}                   ;Yes, do download a packet
  600.          {setv pfl}                 ;ZIPnews personal mail flag
  601.          {ifex-c %qwkdr\%bbsid.%qwk,renqwk};call renqwk routine
  602.          {ifex-c %znpak\%bbsid.%qwk,renqwk};likewise for second directory
  603.          {send ~%yes}
  604.          {call dl_qwk}              ;call download the .qwk routine
  605.  {:ndl}  {pops-c}                   ;No, don't download a packet
  606.          {push}
  607.          {setl 60,ab_mp}            ;allow 60 secs to return to MAILware prompt
  608.          {golo ch_at,%chat_str}     ;respond to sysop CHAT request
  609.          {golo at_bbs,%bbs_pmt}     ;any maildoor returning to BBS
  610.          {golo n|, Try again? (Y/N)};ZIPNEWS failed download
  611.          {golo n|,messages as READ?};Bluewave aborted download
  612.          {golo a|,Enter or Select: };O_QWKer aborted download
  613.          {golo %md_bypa1}           ;generic "continue... " from CS-TABLE
  614.          {look %md_pmt}             ;from MailDoor prompt table
  615.          {setv mail}                ;clear this variable
  616.  ┌─────────────────────────────────────────────────────────────────────────┐
  617.  │  Loop to CS-TABLE.CSM and CS-LOGON:noact for multiple doors in one call │
  618.  └─────────────────────────────────────────────────────────────────────────┘
  619.   *  The variable %bbs is set to NUL on the first pass through CS-TABLE.CSM.
  620.   *  When CS-TABLE.CSM,%mail is called with a NUL %bbs variable, CS-TABLE.CSM
  621.   *   will return control to CS-LOGON:noact
  622.  
  623.   *  To enter a second door on one call, set a variable, %door2, in
  624.   *  COMMO.FON.  You will set %mail, %dorno, and %bbsid in %door2.
  625.   *  ────┬─────               ────┬  ───┬──      ┬─────
  626.   *      └─────> Example; (door2,znr,zipnews|,nlbbs)
  627.   *                       (door3,qm4,qwkmail|,nlbbs)
  628.  
  629.  {:byz}  {comp inet} {ifco ,do_inet}
  630.          {pops-c}
  631.          {incr 2}
  632.          {comp door%2}              ;is there a %door# variable?
  633.          {ifco byz2}                ;if not, bye now
  634.  
  635.          {setv-s parse,door%2}      ;transfer %door# to %parse
  636.          {setv door%2}              ;clear %door# variable
  637.          {setv nodl}                ;allow packet from second door
  638.          {comp at_bbspmt}           ;not at bbs prompt already?
  639.          {ifco-c quit}              ;ifnot, call :quit routine
  640.          {inst parse,,}             ;find first "," in %door#
  641.          {setv pos,%_pos} {decr pos}
  642.          {subs mail,1,%pos,%parse}  ;portion before "," is %mail (MAILWare)
  643.          {incr pos,2}
  644.          {subs parse,%pos,80,%parse};portion after "," is %dorno and %bbsid
  645.          {inst parse,,}             ;find second "," in %door#
  646.          {setv pos,%_pos} {decr pos}
  647.          {subs dorno,1,%pos,%parse} ;portion before "," is %dorno entry command
  648.          {incr pos,2}
  649.          {subs bbsid,%pos,9,%parse} ;portion after "," is %bbsid
  650.          {setv parse}
  651.          {comp debug,y} {ifco ,qwk} ;Will return to CS-LOGON.CSM:noact
  652.          {incr db_ct}
  653.          {disp ,,,## %_24h%:%_min%.%_sec% GETTING DOOR%2 INFO ##%db_ct##}
  654.          {goto qwk,cs-table.csm}    ;Will return to CS-LOGON.CSM:noact
  655.  
  656.  ┌──────────────────────────────────────────┐
  657.  │  "Quit" routine to get back to %bbs_pmt  │
  658.  └──────────────────────────────────────────┘
  659.  {:quit} {comp dorno} {ifco retu}   ;Built-in maildoor IS at the prompt
  660.          {send ~%quit}              ;this quits maildoor
  661.          {push}
  662.          {setl 30,ab_re}            ;allow 30 seconds to return to BBS
  663.          {golo ch_at,%chat_str}     ;respond to sysop CHAT request
  664.          {golo |,Scan Command?}     ;Empty <CR> if PCBoard Quick scan
  665.          {golo %md_bypa1}           ;Genric mailware contine prompt
  666.          {look %bbs_pmt}            ;return to main BBS prompt
  667.          {pops}
  668.          {goto retu}                ;provides debugging assistance
  669.  
  670.  ┌──────────────────────┐
  671.  │  LogOFF or Stay on?  │
  672.  └──────────────────────┘
  673.   *  Again a choice.  Default is to end the connection, but you may
  674.   *  stay ONLINE if you wish.  The macro is setup to open a capture
  675.   *  file if you choose to stay online.
  676.  
  677.  {:byz2} {comp at_bbspmt,y}         ;at bbs prompt already?
  678.          {ifco by_me}               ;ifso, jump to onscreen bye warning
  679.          {comp md_bye}              ;Does this MAILware have a bye command?
  680.          {ifco-c quit}              ;ifnot, call :quit MAILWare routine
  681.  {:by_me}{wind-k}
  682.          {setv _menu1,'G' for Goodbye ■ SPACEbar to capture}
  683.          {setv _menu2, Any other key  ■  Stay, no capture  }
  684.          {setv _mlabel,gb_a}
  685.          {subs _mcolor,31,5,%palette}
  686.          {keys 61}
  687.          {menu 6,41,CS-MAC%ver}
  688.  {:gb_a} {alar 1}
  689.          {setg 10,bye,n}            ;:bye on timeout
  690.          {gets-hi count,1,log_esc}  ;Empty <CR> acts like [ESC]
  691.          {comp count,g} {ifco bye}  ;This timed branch allows
  692.          {comp count, } {ifco sta}  ;  any key to respond
  693.          {goto log_esc}             ;ESC = STAY ONLINE, no capture
  694.  
  695.  {:sta}  {wind}                     ;"Stay" routine with capture
  696.          {setv debug} {setv db_ct}  ;clear debug assistance
  697.          {capt n}                   ;turnoff debug capture if on
  698.          {setv capt}                ;clear flag to avoid closing .CAP
  699.          {capm filter}              ;reset capture mode to filter
  700.          {setv abbr}
  701.          {call capture_}            ;cs-commo.csm:capture_ opens capture file
  702.          {comp keyb}{ifco ,keyb} {} ;load %keyb file per .FON
  703.  
  704.  {:bbs_bye}{send %bye%%rs} {retu}   ;bye from BBS
  705.  {:md_bye} {send %md_bye}  {retu}   ;bye from Maildoor
  706.  
  707.  {:bye}  {wind}
  708.          {comp md_bye}              ;does mail door have bye command?
  709.          {ifco-c bbs_bye,md_bye}    ;call appropriate "bye" response
  710.          {push}
  711.          {setl 15,ab_hu}
  712.  
  713.          {golo loe,<esc>}           ;stifle host delays
  714.          {golo y|, log off }
  715.          {golo n|, comment }
  716.          {golo y|,Are you sure}     ;MajorBBS, Bluewave
  717.  
  718.          {golo y|,Off?}             ;Virtual BBS
  719.          {golo g|,[G] Goodbye...}   ;Babble
  720.          {golo |,?=help]?}          ;MacroBBS & MAXIMUS
  721.          {golo n,your choice -->}   ;EXEC-PC
  722.  
  723.          {golo |,continue}          ;Babble, PCBoard extened exit
  724.          {golo |,ENTER}             ;Silver Express, PowerBBS logoff
  725.          {golo |, [y,n,?=help]?}    ;BlinkLink
  726.          {golo ch_at,%chat_str}     ;respond to sysop CHAT request
  727.  
  728.          {look %inet_pmt}           ;returned to internet provider
  729.                                     ;can be bogus string, never hit
  730.          {ifca bye_inet}            ;goto :bye_inet if online
  731.  {:bya}  {pops-c}                   ;hit here from (noca,bya)
  732.          {comp debug,y} {ifco ,no_dbhu}
  733.          {incr db_ct}
  734.          {disp ,,,## %_24h%:%_min%.%_sec% HANGING UP ##%db_ct##}
  735.          {setv debug} {setv db_ct}  ;clear debug assistance
  736.          {capt n}                   ;turnoff debug capture if on
  737.          {setv capt}                ;clear flag to avoid closing .CAP
  738.          {capm filter}              ;reset capture mode to filter
  739.  {:no_dbhu}
  740.          {ifca-c hang}              ;hangup if carrier isn't gone
  741.          {setv alias}
  742.          {setv abbr}                ;recycle variables
  743.          {call strew_}              ;distribute .QWK/.ZIP/.GIF/.ZNS
  744.          {comp m_call} {ifco fon_dial};goto dialer if m_call is nul
  745.          {goto %m_call}             ;Dial next marked BBS
  746.  {:log_esc}
  747.          {pops-c}                   ;if exit by pressing ESCape
  748.          {setv debug} {setv db_ct}  ;clear debug assistance
  749.          {capt n}                   ;turnoff debug capture if on
  750.          {setv capt}                ;clear flag to avoid closing .CAP
  751.          {capm filter}              ;reset capture mode to filter
  752.          {setv abbr}                ;same as 'Space to stay' except
  753.          {comp keyb} {ifco ,keyb}   ;load %keyb file per .FON
  754.          {retu}                     ; does not open capture file
  755.  
  756.  {:hang} {hang y} {retu}            ;hangup if carrier is there
  757.  
  758.   *  Support to load different keyboard definition files
  759.   *  via %keyb variable.  Examples are PINE, VT102, and VT220
  760.  
  761.  {:keyb} {goto ,%keyb.mac} {}       ;load alternate keyboard macro
  762.  
  763.  ┌─────────────────────────────────┐
  764.  │  Abnormal session terminations  │
  765.  └─────────────────────────────────┘                                 setl timer
  766.  {:ab_rm}{setv msg,Ç CONNECT, Re-mark} {mark %bbsid}   {goto ab_co}  60 seconds
  767.  {:ab_pa}{setv msg,CONNECT to password prompt}         {goto ablog}  60
  768.  {:ab_bb}{setv msg,Password to BBSware prompt}         {goto ablog}  60
  769.  {:ab_mw}{setv msg,BBSware to MAILware prompt}         {goto ablog}  60
  770.  {:ab_mu}{setv msg,Didn't get to ^xB01 upload start}   {goto ablog}  30
  771.  {:ab_up}{setv msg,Upload to MAILware prompt}          {goto ablog} 120
  772.  {:ab_md}{setv msg,Download command to xfer prompt}    {goto ablog} 120
  773.  {:ab_mp}{setv msg,Mail download to MAILware prompt}   {goto ablog}  60
  774.  {:ab_re}{setv msg,Quit MAILware to BBSware prompt}    {goto ablog}  30
  775.  {:ab_hu}{setv msg,Goodbye to carrier lost}                          15
  776.  {:ab_co}{exec-n echo  ^(AB^)  %_ela %msg >> %_uselog}
  777.          {setv msg} {goto bya}
  778.  {:ablog}{exec-n echo  ^(AB^)  %_ela %msg >> %_uselog}
  779.          {setv msg} {goto by_me}
  780.  
  781.  ┌──────────────────────────────────────────┐
  782.  │  .QWK file rename via .bat or via macro  │
  783.  └──────────────────────────────────────────┘
  784.   *  There are many ways to rename mail packets.
  785.   *  RENQWK.BAT present in Commo home directory  ...  use renqwk.bat
  786.   *  Passing these variables from CS-LOGON.CSM to renqwk.bat
  787.   *  %1 = %qwkdr : %2 = %bbsid : %3 = %abbr  %4 = %qwk
  788.   *
  789. *┌---------------  renqwk.bat  -┐    <--  cut here  --
  790. *|  @echo off                   |
  791. *|  ctty nul                    |
  792. *|                              |
  793. *|  del %1\%3__5.%4             |
  794. *|  ren %1\%3__4.%4  %3__5.%4   |
  795. *|  ren %1\%3__3.%4  %3__4.%4   |
  796. *|  ren %1\%3__2.%4  %3__3.%4   |
  797. *|  ren %1\%3__1.%4  %3__2.%4   |
  798. *|  ren %1\%2.%4     %3__1.%4   |
  799. *|                              |
  800. *|  ctty con                    |
  801. *└------------------------------┘    <--  cut here  --
  802.   *
  803.   *  RENQWK.BAT absent from Commo home directory ...  use :renqwk macro
  804.   *
  805.   *  The variable %rdr is used to branch to the macro based rename
  806.   *  method you prefer.  The default method uses the date as part of
  807.   *  the name and allows up to 10 .qwk packets of the same date
  808.   *  (NL-1108.QWK --> NL-1108.QW0 --> NL-1108.QW1 --> etc.)
  809.   *
  810.   *  It would be very easy to change this progression to keep
  811.   *  the file extension ".qwk"
  812.   *  (NL-1108.QWK --> NL-11080.QWK --> NL-11081.QWK --> etc.)
  813.   *
  814.   *  Other supported methods are JABBER  (setv rdr,jbr)
  815.   *                              ZIPNews (setv rdr,znr)
  816.  
  817.  {:renqwk}
  818.          {ifex %_hom%renqwk.bat,ren_bat} ;use .BAT if it exists
  819.          {comp rdr}     {ifco ren_qwk}   ;choose macro rename method
  820.          {goto ren_%rdr}                 ;%rdr == jbr -or- zns
  821.  
  822.  ┌────────────────────────────────┐
  823.  │  Rename method via RENQWK.BAT  │
  824.  └────────────────────────────────┘
  825.  {:ren_bat}
  826.          {exec-n %_hom%renqwk %qwkdr %bbsid %abbr %qwk} ;.QWKfile rename
  827.          {retu}                                         ; via renqwk.bat
  828.  
  829.  ┌──────────────────────────────────────────────────────────┐
  830.  │  Rename method via default macro method described above  │
  831.  └──────────────────────────────────────────────────────────┘
  832.  {:ren_qwk}
  833.          {ifex %qwkdr\%abbr%-%_mon%%_day.%qwk,m_dat}
  834.          {exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.%qwk>NUL}
  835.          {retu}
  836.  {:m_dat}{setv count,0}
  837.  {:m_lop}{ifex %qwkdr\%abbr%-%_mon%%_day.qw%count,,r_mul}
  838.          {incr count}
  839.          {goto m_lop}
  840.  {:r_mul}{exec-n ren %qwkdr\%bbsid.%qwk %abbr%-%_mon%%_day.qw%count>NUL}
  841.          {retu}
  842.  
  843.  ┌───────────────────────────────────────┐
  844.  │  Rename method ala Jabber or ZIPnews  │
  845.  └───────────────────────────────────────┘
  846.   *  Both Jabber and ZIPnews rename routines here share the same core.
  847.   *  Jabber renames mail packets with a three digit extension,
  848.   *  ZIPnews renames with .Z??  between .Z00 and .Z99 for ZIPNews packets
  849.   *  ZIPnews renames with .S??  between .S00 and .S99 for SOUP packets
  850.   *  The rename method is perpetual, taking a string of %max_pak packets
  851.   *  from 000 to 999 and through the 000 threshold (or from 00 to 99
  852.   *  in the case of ZIPnews).
  853.   *  %max_pak must be less than 49 for ZIPnews, less than 499 for Jabber.
  854.  
  855.  {:ren_znr}
  856.          {setv core,%znpak\%bbsid.%qwk} ;packet to be renamed
  857.          {subs ext,1,1,%qwk}            ;S for SOUP, Z for ZIPNews
  858.          {setv dir_mask,%znpak\%bbsid.%ext};directory search mask  (. required)
  859.          {setv ren_pak,%bbsid.%ext}     ;packet rename protocol (. required)
  860.          {setv del_v,100}               ;00-99 = 100 items to loop through
  861.          {setv len,2}                   ;2 digits in "00" and "99"
  862.          {call ren_ext}
  863.          {retu}
  864.  
  865.  {:ren_jbr}
  866.          {setv core,%qwkdr\%bbsid.%qwk} ;packet to be renamed
  867.          {setv dir_mask,%qwkdr\%bbsid.} ;directory search mask  (. required)
  868.          {setv ren_pak,%bbsid.}         ;packet rename protocol (. required)
  869.          {setv del_v,1000}              ;000-999 = 1000 items to loop through
  870.          {setv len,3}                   ;3 digits in "000" and "999"
  871.          {call ren_ext}
  872.          {retu}
  873.  
  874.  {:def_e}{subs ext,1,%len,000}{retu}    ;subroutine - first qwk->000
  875.  {:1st_e}{setv ext,%count} {retu}       ;subroutine - get first value
  876.  {:max_pak}{setv max_pak,10} {retu}     ;subroutine - default %max_pak
  877.  {:0_pad}{retu}
  878.  {:1_pad}{setv ext,0%ext}  {retu}       ;subroutine - pad with zeros
  879.  {:2_pad}{setv ext,00%ext} {retu}       ;subroutine - pad with zeros
  880.  {:sho_ren} {comp sho_,n}  {ifco retu}  ;subroutine - show file activity
  881.          {info-d4s0 REN %core -> %ext  ■  DEL  %del} {retu}
  882.  
  883.  {:ren_ext}
  884.          {comp max_pak} {ifco-c max_pak};default %max_pak = 10
  885.          {decr del_v,%max_pak}          ;determines how far back to delete
  886.          {setv ext}                     ;start with clean slate
  887.          {setv digits,1234567890}       ;only digits are valid extensions
  888.          {file %dir_mask%*}             ;initialize packet dir search
  889.  
  890.  {:dir_loop}                            ;guts of sorting to get next ext
  891.      {subs test,-%len,1,%_ffn}                  ;first char in test ext
  892.      {inst digits,%test} {ifco ,rear}           ; -MUST- be a digit
  893.      {subs count,-%len,%len,%_ffn}              ;get value to test
  894.      {comp ext} {ifco-c 1st_e}                  ;initialize new value
  895.      {comp count,%ext} {ifco-g sub_ext}         ;diff between two values
  896.      {setv temp,%ext}{decr temp,%count}         ;test value is smaller
  897.      {comp temp,%max_pak}{ifco-g front,rear}    ; if by too much, front
  898.  {:sub_ext}
  899.      {setv temp,%count}{decr temp,%ext}         ;test value is larger
  900.      {comp temp,%max_pak}{ifco-g rear,front}    ; if by too much, skipit
  901.  {:front}{setv ext,%count}                      ;last test becomes new ext
  902.  {:rear} {file-x %dir_mask%*}                   ;get next filename to test
  903.      {ifco dir_loop}                            ;loop if we have a filename
  904.  
  905.          {comp ext} {ifco-c def_e}      ;assign 000's if no valid ext found
  906.          {incr ext}                     ;increment largest ext found
  907.          {subs ext,-%len,%len,%ext}     ;always shorten ext to max length
  908.          {setv del,%ext}                ;delete starts as new name ...
  909.          {incr del,%del_v}              ;incremented by "88" or "988" or so
  910.          {subs del,-%len,%len,%del}     ;and truncated to correct # of digits
  911.          {leng %ext}                    ;how many digits in the new extension?
  912.          {decr len,%_len}               ;if too short, pad w/000's
  913.          {call %len%_pad}
  914.          {call sho_ren}                 ;show the screen what's happening
  915.          {exec-n ren %core% %ren_pak%%ext>NUL}
  916.          {exec-n del %dir_mask%%del>NUL};finally, rename and delete
  917.          {setv ren_pak}{setv dir_mask}  ;clear variable space
  918.          {setv digits}{setv del_v}
  919.          {setv core}{setv ext}{setv del}
  920.          {setv test}
  921.          {retu}
  922.  
  923.  ┌───────────────────────────────────────────────┐
  924.  │  .QWK and .REP transfer protocol subroutines  │
  925.  └───────────────────────────────────────────────┘
  926.   *  This arrangement provides a method to use a variety of mail
  927.   *  transfer protocols.  It relies on the protocols in CS-COMMO.CSM
  928.  
  929.  {:mp__z}  {setv mprot,z}       {retu}  ;default to Zmodem
  930.  {:m_prot} {setv _prot,%mprot}  {retu}  ;use %mprot
  931.  {:or_prot}{setv _prot,%or_prot}{retu}  ;use override protocol
  932.  
  933.  {:ul_rep}
  934.          {comp mprot} {ifco-c mp__z}
  935.          {comp or_prot}
  936.          {ifco-c m_prot,or_prot}
  937.          {setv ss_%_prot,~%_prot}
  938.  
  939.          {setl 15,um_#}
  940.          {sslo ss_ur,or Select: }       ;O_QWKer
  941.          {sslo ss_%_prot,which protocol};PowerBBS protocol confirm
  942.          {sslo ss_%_prot,Protocol? }    ;TriMail :tma
  943.          {golo retu,Insufficient}       ;won't see ^xB01, return
  944.          {golo ure_s,^xSMODEM}          ;CS-COMMO will issue the return
  945.          {golo ure_k,^a# N3}
  946.          {golo ure_z,^xB01}
  947.          {look Mail Upload Protocol} {} ;protocols are in CS-COMMO
  948.  
  949.  {:ure_s}{setv _prot,S} {goto um_#}
  950.  {:ure_k}{setv _prot,K} {goto um_#}
  951.  {:ure_z}{setv _prot,Z} {goto um_#}
  952.  
  953.  {:l_qwkdr} {setv dl_dir,%qwkdr}        ;default dir for QWK packets
  954.             {comp %qwk,znr} {ifco-c l_znpak}
  955.             {comp %qwk,sou} {ifco-c l_znpak}
  956.             {retu}
  957.  {:l_znpak} {setv dl_dir,%znpak}  {retu};default dir for SOU, ZNS packets
  958.  {:l_hldr}  {setv dl_dir,%hold_dr}{retu};unless a hold dir is named
  959.  
  960.  {:dl_qwk}
  961.          {comp mprot} {ifco-c mp__z}    ;default protocol is Z
  962.          {comp or_prot}                 ;use %mprot or %or_prot
  963.          {ifco-c m_prot,or_prot}
  964.          {setv ss_%_prot,~%_prot}
  965.          {comp hold_dr}
  966.          {ifco-c l_qwkdr,l_hldr}        ;determine download directory
  967.  
  968.          {setl 15,d_mail}               ;15 seconds of inactivity starts d/l
  969.          {sslo ss_bs,^m}                ;reset timer on activity
  970.          {sslo ss_gr,<G> to start}      ;DCQwk   :dcq
  971.          {sslo ss_r,or wait 10}         ;        :coq
  972.          {sslo ss_r, <enter> }          ;        :mxr
  973.          {sslo ss_%_prot,Protocol? }    ;TriMail :tma
  974.          {golo byz,%md_pmt}             ;maildoor packing error
  975.  
  976.          {golo dqw_s,^xSMODEM}          ;jump to Smodem routine
  977.          {golo dqw_k,^a5 S~}            ;jump to Kermit routine
  978.          {golo dqw_z,^xB00}             ;jump to Zmodem routine
  979.  
  980.          {look Mail Download Protocol}{};protocols are in CS-COMMO
  981.  
  982.  {:dqw_s}{setv _prot,S} {goto d_mail}
  983.  {:dqw_k}{setv _prot,K} {goto d_mail}
  984.  {:dqw_z}{setv _prot,Z} {goto d_mail}
  985.  
  986.  ┌───────────────────────────────────┐
  987.  │  File distribution from Hold dir  │
  988.  └───────────────────────────────────┘
  989.   *  This subroutine is called at the end of each call.
  990.   *  If %hold_dr is named;
  991.   *     .ZNS, and .SOU  files are moved into                    %znpak
  992.   *     .QWK, .OLX, and %_dwt?  files are moved into            %qwkdr
  993.   *     .GIF, .RLE, .BMP, .TIF, and .PCX files are moved into   %picdr
  994.   *     .ZIP, .LZH, .ARC, .EXE, .DWC, and .ZOO  files into      %dldir,
  995.   *                        Other files remain in %hold_dr.
  996.  
  997.  {:sho_mov} {comp sho_,n} {ifco retu}   ;subroutine - show file activity
  998.          {info-d2s0  Moving %hold_dr\%move_f to %m_dir } {retu}
  999.  
  1000.  {:strew_}                              ;start hold_dr distribution
  1001.          {comp %hold_dr} {ifco retu}    ;if %hold_dr is NUL, skip distribution
  1002.          {subs dw,1,2,%_dwt}            ;first two char of day-of-week
  1003.          {setv zn_exts,.zns.sou}                ;set exts move to %znpak
  1004.          {setv qw_exts,.qwk.olx.%dw?} {setv dw} ;set exts move to %qwkdr
  1005.          {setv pi_exts,.gif.rle.bmp.tif.pcx}    ;set exts move to %picdr
  1006.          {setv dl_exts,.zip.lzh.arc.exe.dwc.zoo};set exts move to %dldir
  1007.  
  1008.          {comp hold_dr,%znpak}          ;does hold dir == ZIPnews packet dir
  1009.          {ifco-c ,mov_zns}              ;ifso, don't move ZNSs
  1010.          {comp hold_dr,%qwkdr}          ;does hold dir == qwk file directory
  1011.          {ifco-c ,mov_qwk}              ;ifso, don't move QWKs
  1012.          {comp hold_dr,%picdr}          ;does hold dir == Picture directory?
  1013.          {ifco-c ,mov_gif}              ;ifso, don't move GIFs
  1014.          {comp hold_dr,%dldir}          ;does hold dir == download dir
  1015.          {ifco-c ,mov_dl}               ;ifso, don't move ZIPs
  1016.  
  1017.          {setv move_f}                  ;clear last filename transferred
  1018.          {setv m_dir}                   ;clear move-to directory
  1019.          {setv f_match}                 ;clear match extension list
  1020.          {setv cn} {setv coun,0}        ;clear counters
  1021.          {setv zn_exts} {setv qw_exts}  ;clear strew extension definitions
  1022.          {setv pi_exts} {setv dl_exts}
  1023.          {retu}                         ;end hold_dr distribution
  1024.  
  1025.  {:mov_dl} {ifex %dldir\NUL,,retu}      ;no move unless dir exists
  1026.            {setv f_match,%dl_exts}      ;look for these extensions
  1027.            {setv m_dir,%dldir}          ;move to this directory
  1028.            {goto list_mov}
  1029.  {:mov_gif}{ifex %picdr\NUL,,retu}
  1030.            {setv f_match,%pi_exts}      ;each separate move-to directory
  1031.            {setv m_dir,%picdr}          ;needs extensions and where-to info
  1032.            {goto list_mov}
  1033.  {:mov_qwk}{ifex %qwkdr\NUL,,retu}
  1034.            {setv f_match,%qw_exts}
  1035.            {setv m_dir,%qwkdr}
  1036.            {goto list_mov}
  1037.  {:mov_zns}{ifex %znpak\NUL,,retu}
  1038.            {setv f_match,%zn_exts}
  1039.            {setv m_dir,%znpak}
  1040.            {goto list_mov}
  1041.  
  1042.  {:list_mov}
  1043.          {setv coun,1} {setv cn,1}      ;list and move counters
  1044.          {file %hold_dr\*.*}            ;get first filename in hold dir
  1045.  {:td_ext}
  1046.          {subs ext,-4,3,%_ffn}          ;extract file extension - with dot
  1047.          {inst f_match,%ext}            ;check .EXT for match
  1048.          {ifco-c add_mofn}              ;add to move list, incr %count
  1049.          {file-x %hold_dr\*.*}          ;get next filename
  1050.          {ifco td_ext}                  ;read to end of directory
  1051.          {comp coun,1}                  ;if no match return
  1052.          {ifco retu,mov_loop}           ;otherwise, goto mov_loop
  1053.  
  1054.  {:add_mofn}                            ;add_move_filename to
  1055.          {setv move_f%coun,%_ffn}       ;Commo variable space
  1056.          {incr coun} {retu}
  1057.  
  1058.  {:mov_loop}
  1059.          {comp cn,%coun} {ifco-e retu}  ;when done moving, return
  1060.          {setv-s move_f,move_f%cn}      ;expand move_f%cn variable
  1061.          {setv move_f%cn}               ; clear %move_f1 for example
  1062.          {incr cn}
  1063.  
  1064.  {:chkdup}{ifex %m_dir\%move_f,,ok_move} ;if file exists ...
  1065.          {subs qwk,-3,3,%move_f}         ;check extension
  1066.          {comp qwk,qwk}  {ifco strenq}   ;if .QWK, rename it
  1067.          {comp qwk,sou}  {ifco strens}   ;if .SOU, rename it
  1068.          {comp qwk,zns}  {ifco strenz}   ;if .ZNS, rename it
  1069.          {info-d5s0  Not moving %hold_dr\%move_f, that filename is already in %m_dir }
  1070.          {goto mov_loop}                 ;try next filename
  1071.  {:ok_move}
  1072.          {call sho_mov}
  1073.          {exec-n copy %hold_dr\%move_f %m_dir>NUL}  ;DOS copy and delete
  1074.          {exec-n del %hold_dr\%move_f>NUL}
  1075.          {goto mov_loop}
  1076.  
  1077.  {:strenq} {setv rdr,%qrdr} {call gbbsid} {call renqwk} {goto chkdup}
  1078.  {:strens} {setv rdr,%znr}  {call gbbsid} {call renqwk} {goto chkdup}
  1079.  {:strenz} {setv rdr,%znr}  {call gbbsid} {call renqwk} {goto chkdup}
  1080.  
  1081.  {:gbbsid} {inst move_f,.} {setv len,%_pos} {decr len}
  1082.            {subs bbsid,1,%len,%move_f}
  1083.            {subs abbr,1,2,%bbsid} {retu}
  1084.  
  1085.  ┌────────────────────────────────────────┐
  1086.  │  Functions called from %flag variable  │
  1087.  └────────────────────────────────────────┘
  1088.  {:newfiles}
  1089.          {setv strip,n}
  1090.          {call stripflag}
  1091.          {send n s u|}
  1092.          {clea}
  1093.          {exec-n echo OPENED  ■  %_dat %_tim^j>> %savedir\newfiles.%abbr}
  1094.          {capt y,%savedir\newfiles.%abbr}
  1095.          {push}
  1096.          {golo |,more?}
  1097.          {look %bbs_pmt}
  1098.          {pops}
  1099.          {clea}
  1100.          {capt n}
  1101.          {exec-n echo CLOSED  ■  %_dat %_tim^j>> %savedir\newfiles.%abbr}
  1102.          {retu}
  1103.  
  1104.  ┌──────────────────────────────────────────┐
  1105.  │  Strip the acted-on function from %flag  │
  1106.  └──────────────────────────────────────────┘
  1107.   *  This subroutine strips the variable %flag of one character
  1108.   *  so that each %flag function is run only once.
  1109.  
  1110.  {:stripflag}
  1111.          {inst %flag,%strip}
  1112.          {comp _pos,1}  {ifco fl2}
  1113.          {setv pos,%_pos}               {decr pos}
  1114.          {subs flag1,1,%pos,%flag}
  1115.   {:fl2} {setv pos,%_pos}               {incr pos}
  1116.          {subs flag2,%pos,36,%flag}
  1117.          {setv flag,%flag1%%flag2}
  1118.          {setv pos}
  1119.          {setv strip}
  1120.          {setv flag1}
  1121.          {setv flag2}
  1122.          {retu}
  1123.  
  1124.  ┌─────────────────────────┐
  1125.  │  Respond to Sysop Chat  │
  1126.  └─────────────────────────┘
  1127.   *  Responds when sysop breaks into your mailrun.  Asks him/her
  1128.   *  to return you to the command line.  Turns on a capture file
  1129.   *  %savedir\chat.cap and sets %ap_capt for possible Autopilot use.
  1130.  
  1131.  {:ch_at}{capt y,%savedir\chat.cap}
  1132.          {paus 5}
  1133.          {send Excuse me.|| ~~~May I type first?||}
  1134.          {setl 10,ch_00}
  1135.          {golo ch_00,ok}
  1136.          {golo ch_00,sure}
  1137.          {golo ch_00,yes}
  1138.          {look ^m^j^m^j}
  1139.  {:ch_00}{paus 3}
  1140.          {send Thanks.  ~~I'm nothing but a ^(Commo^) macro but ~~I had the}
  1141.          {send good sense to be prepared for your inevitable interruption ~~<G>.  }
  1142.          {send ~~So, you have my attention, and your comments are being saved to}
  1143.          {send ~~a capture file.  When you are done, I will be looking for a fresh}
  1144.          {send command line.  ~~If I appear stalled, please hang up on me.  }
  1145.          {send ~~Too bad you didn't catch me at home.  CYA!|||}
  1146.          {setl}
  1147.          {look %bbs_pmt}
  1148.          {clea}
  1149.          {capt n}
  1150.          {setv ap_chat,CHAT}
  1151.          {retu}
  1152.  
  1153.  ┌──────────────────────────────────────────┐
  1154.  │  Mark and telnet from Internet provider  │
  1155.  └──────────────────────────────────────────┘
  1156.   *  Telnet uses a special dial prefix, %tn_pf, set in CS-MACxx.CFG
  1157.   *  I use the string "Trying" as the success response.  It is set
  1158.   *    in do_inet if not already there.
  1159.   *  Use i_qwk as the marked macro name in your telnet directory
  1160.   *  :do_inet is called from BBSprompt if %inet is a non-NUL value
  1161.   *  Mark, telnet, and run the :qwk mailrun routine
  1162.  
  1163.  {:trying}{setv _dialsr,%_dialsr,Trying}
  1164.  {:do_inet}
  1165.          {comp pfl,y} {ifco d_l};get mail from internet provider before
  1166.                                 ; telnetting to target BBS
  1167.          {setv mail}
  1168.          {inst %_dialsr,Trying} {ifco-c ,trying}
  1169.          {mark >%inet}          ;mark BBS name in commo.fon file
  1170.          {dial 1,no_inet}       ;dial and goto the :i_qwk linked macro
  1171.          {}
  1172.  {:no_inet} {unma-l} {goto %m_call}
  1173.  
  1174.   *  Get past the terminal server and into the BBS
  1175.   *  Hangup if "telnet>" or internet provider prompt reappears
  1176.   *    this occurs if connection times out
  1177.  
  1178.  {:i_qwk}{setv inet}
  1179.          {setv port,No available ports}
  1180.          {setv msg,Normal logoff}
  1181.          {setl}
  1182.          {push}
  1183.          {golo ctl-],No available ports}        ;unable to logon
  1184.          {golo q|,telnet>}                      ;quit telnet session
  1185.          {golo ab_byein,%inet_pmt}              ;hang-up
  1186.  
  1187.          {golo bbs,login: }                     ;normal logon responses
  1188.          {golo |,Password:}
  1189.          {look Session established} {pops}      ;past the server
  1190.  
  1191.          {gets port}                            ;nlbbs port tracker
  1192.          {call port}
  1193.  
  1194.          {setv cc_c,0}                          ;Ctl-C counter
  1195.          {push}
  1196.          {setl 20,ctl-c}                        ;jump start BBS with telnet
  1197.          {golo sn_ip,telnet>}                   ;  "interrupt process"
  1198.          {golo ab_cclo, closed by foreign host.}
  1199.          {golo bye_inet,%inet_pmt}              ;hangup if host connection lost
  1200.          {golo _|, Login:}                      ;NLFE front end
  1201.          {look CONNECT }            {pops}      ;on the BBS
  1202.          {setv cc_c}
  1203.          {goto qwk}                             ;pass control to regular mail
  1204.  
  1205.  {:sn_ip}{send send ip|} {retu}
  1206.  {:ctl-]}{send ^]} {retu}
  1207.  {:ctl-c}{comp cc_c,1} {ifco-g ab_ccc}          ;try Ctl-C twice
  1208.          {send ^C} {incr cc_c}
  1209.          {setv port,%port Req'd Ctl-C}{call port}{retu}
  1210.  
  1211.  {:port} {comp chuck} {ifco retu}
  1212.          {exec-n echo %_dat  %_24h%:%_min%:%_sec %port >> %savedir\nlbbs.por}
  1213.          {setv port} {retu}
  1214.  
  1215.   *  Hang up from internet provider
  1216.  {:ab_ccc}   {setv msg, Server connection established.  No BBS Logon.}
  1217.              {send ^]}      {look telnet>}
  1218.              {send close|}  {golo q|,telnet>}
  1219.              {look %inet_pmt}
  1220.              {goto bye_inet}
  1221.  {:ab_cclo}  {setv msg, Connection closed by foreign host}
  1222.              {goto bye_inet}
  1223.  {:ab_byein} {setv msg, telnet attempt timed out}
  1224.              {exec-n echo  ^(AB^)  %_ela %msg >> %_uselog}
  1225.  {:bye_inet}
  1226.  {exec-n echo %_dat  %_24h%:%_min%:%_sec %msg >> %savedir\nlbbs.por}
  1227.          {setv port}
  1228.          {pops}
  1229.          {setl 30,ab_hu}
  1230.          {push}
  1231.          {send %inet_bye|}
  1232.          {golo q|,telnet>}
  1233.          {look Leaving %_nam}   ;loss of carrier goes to :bya
  1234.